package com.oracle.sbdb.servlet.model;

import java.util.ArrayList;
import java.util.List;

public class BugInformation {
	private Integer bugID;
	private String subject;
	private String product;
	private String component;
	private String assignee;
	private String support;
	private String customer;
	private String status;
	private String severity;
	private String bugType;
	private String genAndPrt;
	private String OS;
	private String OSRelease;
	private List<BugUpdates> updatesList;

	public BugInformation() {
	};

	public BugInformation(Integer bugID, String subject, String product,
			String component, String assignee, String support, String customer,
			String status, String severity, String bugType, String genAndPrt,
			String OS, String OSRelease, List<BugUpdates> updatesList) {
		setBugID(bugID);
		setSubject(subject);
		setProduct(product);
		setComponent(component);
		setAssignee(assignee);
		setSupport(support);
		setCustomer(customer);
		setStatus(status);
		setSeverity(severity);
		setBugType(bugType);
		setGenAndPrt(genAndPrt);
		setOS(OS);
		setOSRelease(OSRelease);
		setUpdatesList(updatesList);
	}

	public BugInformation(Integer bugID, String subject, String product,
			String component, String assignee, String support, String customer,
			String status, String severity, String bugType, String genAndPrt,
			String OS, String OSRelease) {
		setBugID(bugID);
		setSubject(subject);
		setProduct(product);
		setComponent(component);
		setAssignee(assignee);
		setSupport(support);
		setCustomer(customer);
		setStatus(status);
		setSeverity(severity);
		setBugType(bugType);
		setGenAndPrt(genAndPrt);
		setOS(OS);
		setOSRelease(OSRelease);
	}

	public Integer getBugID() {
		return bugID;
	}

	public void setBugID(Integer bugID) {
		this.bugID = bugID;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getProduct() {
		return product;
	}

	public void setProduct(String product) {
		this.product = product;
	}

	public String getComponent() {
		return component;
	}

	public void setComponent(String component) {
		this.component = component;
	}

	public String getAssignee() {
		return assignee;
	}

	public void setAssignee(String assignee) {
		this.assignee = assignee;
	}

	public String getSupport() {
		return support;
	}

	public void setSupport(String support) {
		this.support = support;
	}

	public String getCustomer() {
		return customer;
	}

	public void setCustomer(String customer) {
		this.customer = customer;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSeverity() {
		return severity;
	}

	public void setSeverity(String severity) {
		this.severity = severity;
	}

	public String getBugType() {
		return bugType;
	}

	public void setBugType(String bugType) {
		this.bugType = bugType;
	}

	public String getGenAndPrt() {
		return genAndPrt;
	}

	public void setGenAndPrt(String genAndPrt) {
		this.genAndPrt = genAndPrt;
	}

	public String getOS() {
		return OS;
	}

	public void setOS(String OS) {
		this.OS = OS;
	}

	public String getOSRelease() {
		return OSRelease;
	}

	public void setOSRelease(String OSRelease) {
		this.OSRelease = OSRelease;
	}

	public List<BugUpdates> getUpdatesList() {
		return updatesList;
	}

	public void initUpdatesList() {
		this.updatesList = new ArrayList<BugUpdates>();
	}

	public void setUpdatesList(List<BugUpdates> updatesList) {
		this.updatesList = updatesList;
	}

	public boolean addUpdates(BugUpdates updates) {
		if (updatesList != null) {
			updatesList.add(updates);
			return true;
		}

		return false;
	}

	public String toString() {
		String res = "";
		res += "bugID:" + bugID;
		res += "\n subject: " + subject;
		res += "\n product:" + product;
		res += "\n component:" + component;
		res += "\n assignee:" + assignee;
		res += "\n support:" + support;
		res += "\n customer:" + customer;
		res += "\n status:" + status;
		res += "\n severity:" + severity;
		res += "\n bugType:" + bugType;
		res += "\n genAndPrt:" + genAndPrt;
		res += "\n OS:" + OS;
		res += "\n OSRelease:" + OSRelease;
		res += "\n Updates:";
		for (BugUpdates bugUpdates : updatesList) {
			res += "\n :" + bugUpdates.toString();
		}
		return res;
	}
}
